#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

char* my_strncpy(char* dest, const char* src, size_t num) {
	while (num--) {
		*dest++ = *src++;
	}
}

char* my_strncat(char* dest, const char* src, size_t num) {
	while (*((dest++) + num) = *src++) {
		;
	}
}

int my_strncmp(const char* str1, const char* str2, size_t num) {
	int ret = 0;
	while (num--) {
		ret = *str2 - *str1;
		++str2;
		++str1;
	}
	if (ret < 0)
		ret = -1;
	else if (ret > 0)
		ret = 1;
	return ret;
}

int my_atoi(const char* str) {
	return *str - '0';
}


int main() {
	char arr[] = "1234";
	int val = my_atoi(arr);
	printf("%d %s", val,arr);
}